<template>
	<div>
		<div class="banner" @click="handleClickGallary">
			<img class="top-img" :src="bannerImg" />
			<div class="banner-info">
				<div class="img-num">
					<span class= "iconfont banner-icon" >&#xe606;</span>
					{{imgNum}}
				</div>
				<div class="info">{{this.sightName}}</div>
			</div>
			
		</div>
		<fade-animation>
			<common-gallary :imgs="gallaryImgs" v-show="showGallary" @closeGallary='handleCloseGallary'></common-gallary>
		</fade-animation>
	</div>
</template>

<script>
	import commonGallary from 'common/gallary/Gallary'
	import fadeAnimation from 'common/fade/fadeAnimation'
	export default{
		name:'detailBanner',
		components:{
			commonGallary,
			fadeAnimation
		},
		props: {
			sightName:String,
			bannerImg:String,
			gallaryImgs:Array
		},
		computed: {
			imgNum () {
				return this.gallaryImgs.length
			}
		},
		data () {
			return {
				imgs:[
					'http://img1.qunarzz.com/wugc/p123/201211/19/a2045d091f02b25493835fbb.png_350x240_cf4cd08e.png',
					'http://img1.qunarzz.com/sight/p55/201211/04/fbcab3e5d6479ce893835fbb.jpg_350x240_df8ba9f7.jpg'
					],
				showGallary:false
				
			}
		},
		methods: {
			handleClickGallary () {
				this.showGallary=!this.showGallary
			},
			handleCloseGallary () {
				this.showGallary=!this.showGallary
			}
		}
	}
</script>

<style lang="stylus" scoped>
	.banner
		position:relative
		overflow:hidden
		height:0
		padding-bottom:55%
		.top-img
			width:100%
		.banner-info
			display:flex
			flex-direction:column
			position:absolute
			line-height:.44rem
			padding:.2rem
			left:0
			bottom:0
			color:#fff
			.info
				font-size:.36rem
			.img-num
				font-size:.24rem
				background:rgba(0,0,0,.8)
				border-radius:.6rem
				padding:.05rem .2rem
				width:.8rem
				line-height:.32rem
				text-align:center
				margin:.05rem 0
				.banner-icon
					font-size.06rem
		
				
</style>